package com.easonji.common.factory.impl;

import com.easonji.common.constant.enums.IsMenuEnum;
import com.easonji.common.constant.enums.UserSexEnum;
import com.easonji.common.factory.ConstsFactory;
import org.springframework.stereotype.Component;

import com.easonji.core.log.LogObjectHolder;

/**
 * @ClassName: ConstsFactoryImpl
 * @Description: 常量工厂
 * @Author: LiuJun
 * @date: 2018/07/25 16:24
 * @Version: 1.0
 * @Copyright: Copyright (c) 2018 - 2019
 */
@Component
public class ConstsFactoryImpl implements ConstsFactory {

    /**
     * 获取被缓存的对象(用户删除业务)
     */
    @Override
    public String getCacheObject(String para) {
        return LogObjectHolder.me().get().toString();
    }

    /**
     * 获取性别名称
     */
    @Override
    public String getSexName(Integer code) {
        return UserSexEnum.valueOf(code);
    }

    @Override
    public String getIsMenuName(Integer code) {
        return IsMenuEnum.valueOf(code);
    }
}
